<template>
	<view>
		<view class="list">
			<view class="one" @click="goToApplication(0)">
				我的申请
			</view>
			
			<view class="one" @click="goToApprove">
				我的审批
			</view>
			
			<view class="one" v-if="admin" @click="goToApplication(1)">
				所有申请
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				admin:false
			};
		},
		onShow() {
			if (uni.getStorageSync("enterprise").adminId == uni.getStorageSync("userId")) {
				this.admin = true
			} else {
				this.admin = false
			}
		},
		methods:{
			goToApplication(e){
				uni.navigateTo({
					url:"/pages/enterprise/application/application?type="+e
				})
			},
			goToApprove(){
				uni.navigateTo({
					url:"/pages/enterprise/approve/approve"
				})
			}
		}
	}
</script>

<style lang="scss">
	.list{
		display: flex;
		margin: 5vw;
		flex-wrap: wrap;
		
		.one {
			margin: 2vw;
			width: 26vw;
			height: 26vw;
			text-align: center;
			line-height: 26vw;
			box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
		}
	}
</style>
